package com.example.project.controller;



import com.example.project.pojo.Bj;
import com.example.project.pojo.Two;
import com.example.project.service.TwoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

@RestController
public class TwoController {

    @Autowired
    TwoService twoService;
    @RequestMapping("/selectByTeacherName")
    public String selectByTeacherName(String teacherName, HttpSession session){
        List<Two> two = twoService.selectByTeacherName(teacherName);
        session.setAttribute("two",two);
        return two.toString();
    }
}
